home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 11 - 1995 / 11.02 Feb 95 / Yenta / Erics C++ Libraries / Interface Classes / CPPPictButton.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-04  |  1.6 KB  |  60 lines  |  [TEXT/KAHL]

  1. /********************************************************* DEFINITION
  2.     DATE:    9/23/93
  3.     AUTHOR: Eric R. Rosé
  4.     
  5.     CLASS:  CPPPictButton
  6.     
  7.     SUPERCLASS: CPPVisualObject
  8.     
  9.         This C++ class manages a button which is drawn with pictures
  10.         rather than a control definition.  
  11.     
  12. ********************************************************************/
  13.  
  14. #pragma once
  15.  
  16. #include <CPPVisualObject.h>
  17.  
  18. #define        kUsePicture        1
  19. #define        kUseInvert        2
  20. #define        kUseDarken        3
  21.  
  22. class CPPPictButton : public CPPVisualObject {
  23. public:
  24.             CPPPictButton (CPPWindow *itsWindow, short upPictID,
  25.                          short downPictID, Point topLeft,
  26.                          Boolean isFramed = FALSE,
  27.                          Boolean canBeTarget = FALSE,
  28.                          Boolean active = FALSE, Boolean visible = TRUE);
  29.             CPPPictButton (CPPWindow *itsWindow, short thePictID,
  30.                          Point topLeft, short hiliteMethod,
  31.                          Boolean isFramed = FALSE,
  32.                          Boolean useWindowFont = FALSE,
  33.                          Boolean canBeTarget = FALSE,
  34.                          Boolean active = FALSE, Boolean visible = TRUE);
  35.             ~CPPPictButton (void);
  36.  
  37.     virtual    char     *ClassName (void);
  38.         
  39.     virtual    Boolean    DoClick (EventRecord *theEvent);
  40.  
  41.     virtual    void    Activate (Boolean nowActive);
  42.     virtual    void    MakeVisible (Boolean nowVisible);
  43.     virtual    void    MoveContent (short newH, short newV);
  44.     virtual    void    ResizeContent (short newWidth, short newHeight);
  45.     virtual    void    Draw (void);
  46.     virtual    Rect    *GetBounds (void);
  47.     
  48.     virtual    void    DoOnClick (void);
  49.     virtual    void    EnableButton (Boolean nowEnabled);
  50.         
  51. private:
  52.     Boolean            isEnabled;
  53.     Boolean            hasFrame;
  54.     PicHandle        upPict, downPict;
  55.     short            hiliteType;
  56.  
  57.             Boolean    TrackPictButton (Point thePoint);
  58.             void    HilightButton (Boolean doHilight);
  59.  
  60. };